package functionInterface;

import org.junit.Test;

import java.util.function.Supplier;

/**
 * @Author com.alibaba.lizhen
 * @Date 2021/3/23 5:51 下午
 * @Version 1.0
 * @Description
 */
public class SupplierTest {
    @Test
    public void test(){
        String value = getValue(() -> "123");
        System.out.println(value);
    }

    /**
     *  Supplier<T> 供给型接口
     * @param sup
     * @return
     */
    public String getValue(Supplier<String> sup){
        return sup.get();
    }

}
